#!/usr/bin/env python
# -*- coding: utf-8 -*-

import envs
import time
import rospy

from std_msgs.msg import String


class Audio():
    def __init__(self):
        self.audio_pub = rospy.Publisher('/speak', String, queue_size=1)
        self.data = String()
        time.sleep(0.2)

    def say(self, msg):
        self.data.data = msg
        self.audio_pub.publish(self.data)


if __name__ == '__main__':
    rospy.init_node('npu_robot_audio', anonymous=True, log_level=envs.log_level)
    audio = Audio()
    audio.say('道路千万条，安全第一条')
    # audio.say('hello')
